﻿using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Text;
using DTTB.Common;
using DTTB.DAO.Base;
using DTTB.Domain;

namespace DTTB.DAO
{
    public class UserInJobTitleInDepartmentDao : BaseDao<UserInJobTitleInDepartment>
    {
       public IList<UserInJobTitleInDepartment> GetUserInJobTitleInDepartmentByUserId(string userId)
       {
           CommandText = "Select * from TB_UserInJobTitleInDepartment where UserId = " + userId + " and IsDelete = 0";

           Commandtype = CommandType.Text;

           DataTable table = GetDataTable();

           IList<UserInJobTitleInDepartment> list = CollectionHelper.ConvertTo<UserInJobTitleInDepartment>(table);

           return list;
       }

       public bool DeleteUserInJobTitleInDepartmentByUserId(string userId)
       {
           string sqlQuery = " Delete from TB_UserInJobTitleInDepartment where UserId = " + userId;
           return this.ShiftDelete(sqlQuery);
       }


    }
}
